<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>교통정보 검색</title>
		<script>
		</script>
	</head>
	<body>
		<table style="border:1px solid #FFF;height:30px;background-color:#e1f0f5;" width="700">
			<thead>
				<tr>
					<td colspan="3">검색 결과</td>
				</tr>
			</thead>
			<tbody>
				<c:forEach begin="0" items="${terminalTemps}" var="terminalTemp" varStatus="bb">
				
					<c:set value="${fn:length(terminalTemp.terminals)}" var="tLength"/>
					<c:set value="${fn:length(terminalTemp.timetables)}" var="ttLength"/>
				
					<tr style="border:1px solid #000;">
						<td width="200" align="center">
							<table width="120" style="border:1px solid #fff;">
								<thead>
									<tr>
										<td align="center" height="30">출발지</td>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td align="center" style="background-color:#fff;;height:25px;"><a href="/Test1/TerminalDetailInfo.action?terminalName=${terminalTemp.terminals[0].terminalName}">${terminalTemp.terminals[0].terminalName}</a></td>
									</tr>
									<tr>
										<td align="center"><a href="/Test1/TimetableView.action?timetableId=${terminalTemp.timetables[0]}">시간표보기</a></td>
									</tr>
									<tr>
										<td align="center"><a href="/Test1/AreaInfo.action?query=${terminalTemp.terminals[0].terminalName}">지역정보</a></td>
									</tr>
								</tbody>
							</table>
						</td>
						
						<td align="center" valign="middle">
							거리 : ${terminalTemp.distance}Km &nbsp;,&nbsp;시간 : ${terminalTemp.totalTime}<br/><br/>
							<img src="./image/arrow/111.png"/>
						</td>
						
						
						
						<td width="200">
							<table align="center" width="120"  style="border:1px solid #fff;">
								<thead>
									<tr>
										<td align="center" height="30">도착지</td>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td align="center" style="background-color:#fff;;height:25px;"><a href="/Test1/TerminalDetailInfo.action?terminalName=${terminalTemp.terminals[tLength-1].terminalName}">${terminalTemp.terminals[tLength-1].terminalName}</a></td>
									</tr>
									<tr>
										<td align="center"><a href="/Test1/AreaInfo.action?query=${terminalTemp.terminals[tLength-1].terminalName}">지역정보</a></td>
									</tr>
								</tbody>
							</table>
						</td>
					</tr>
					<tr>
						<td colspan="3" align="center">
							<table width="300">
								<thead>
									<tr>
										<td align="center" height="30" colspan="5">경유지 정보</td>
									</tr>
								</thead>
								<tbody>
									<c:forEach begin="1" end="${tLength-2}" items="${terminalTemp.terminals}" var="passTerminal" varStatus="bb">
										<tr>
											<td align="center"><a href="/Test1/TerminalDetailInfo.action?terminalName=${passTerminal.terminalName}">${passTerminal.terminalName}</a></td>
											<td align="center"><a href="/Test1/TimetableView.action?timetableId=${terminalTemp.timetables[bb.index]}">시간표보기</a></td>
											<td align="center"><a href="/Test1/AreaInfo.action?query=${passTerminal.terminalName}">지역정보</a></td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
		
		<br/>
		<br/>
		
		
		<table width="700"  style="border:1px solid #fff;">
			<thead>
				<tr>
					<td colspan="3">광고들</td>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td width="150" height="50" align="center" style="background-color:#e1f0f5;">
						<img src="./image/banner/1.jpg" width="150" height="50"/><br/>츄파츕스</td>
					<td width="150" height="50" align="center" style="background-color:#e1f0f5;">
						<img src="./image/banner/2.jpg" width="150" height="50"/><br/>Applet ipod</td>
					<td width="150" height="50" align="center" style="background-color:#e1f0f5;">
						<img src="./image/banner/3.jpg" width="150" height="50"/><br/>17차</td>
				</tr>
				<tr>
					<td width="150" height="50" align="center" style="background-color:#e1f0f5;">
						<img src="./image/banner/4.jpg" width="150" height="50"/><br/>soul</td>
					<td width="150" height="50" align="center" style="background-color:#e1f0f5;">
						<img src="./image/banner/5.jpg" width="150" height="50"/><br/>money</td>
					<td width="150" height="50" align="center" style="background-color:#e1f0f5;">
						<img src="./image/banner/6.jpg" width="150" height="50"/><br/>racing girl</td>
				</tr>
			</tbody>
			<tfoot>
				<tr>
					<td colspan="3">&nbsp;</td>
				</tr>	
			</tfoot>
		</table>
	</body>
	</body>
</html>
			 